package cn.edu.scujcc;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/user")
public class UserController {

	@Autowired
	private UserService service;
	@GetMapping
	public List<User> getAllUser(){
		List<User>result = null;
		result = service.getAllUser();
		return result;
	}
	@GetMapping("/{id}")
	public User getUser(@PathVariable String id) {
	User result = null;
	result = service.getUser(id);
	return result;
	}
	
	@PostMapping("/dynamic")
	public User createDynamic(@PathVariable String dynamic) {
	User result = null;
	result = service.createDynamic(dynamic);
	return result;
	}
}
